#!/usr/bin/env bash
BUILD_TOOLS_DIR=$(cd $(dirname ${BASH_SOURCE[0]}); pwd)
PATH=$PATH:${BUILD_TOOLS_DIR}
USER=$(whoami)
UNAME=$(uname)
if [ "$UNAME" = "Darwin" ]
then
    echo Darwin
    USER_HOME=/Users/${USER}
    export HOST=darwin
else
    echo Linux
    USER_HOME=/home/${USER}
    export HOST=linux
fi
if [ -z "${ANDROID_SDK_HOME}" ];then
    ANDROID_SDK_HOME=${USER_HOME}/android-env/android-sdk-linux
fi
export TOP_DIR=`pwd`
if [ -z "${ANDROID_NDK}" ];then
    export ANDROID_NDK=${USER_HOME}/android-env/android-ndk-r14b
fi

PATH=$PATH:${ANDROID_NDK}:${ANDROID_NDK}/toolchains/arm-linux-androideabi-4.9/prebuilt/${HOST}-x86_64/bin
PATH=$PATH:${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/${HOST}-x86_64/bin
PATH=$PATH:${ANDROID_SDK_HOME}/platform-tools


export ANDROID_NDK_ROOT=${ANDROID_NDK}
export ANDROID_BUILD_DIR=`pwd`
export ANDROID_NDK_HOME=${ANDROID_NDK}
export NDK_ROOT=${ANDROID_NDK}
export VERSION=$MUPP_BUILD_ID

echo "VERSION is ${VERSION}"
git config core.hooksPath ${TOP_DIR}/git_hooks
source build_player.sh

